home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / fire-man.swf / scripts / frame_1179 / PlaceObject2_1097_69 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2011-10-17  |  1.3 KB  |  61 lines

  1. onClipEvent(enterFrame){
  2.    function wallizq()
  3.    {
  4.       return dx < 0 && mapa.hitTest(_X,_Y,true);
  5.    }
  6.    function wallder()
  7.    {
  8.       return dx > 0 && mapa.hitTest(_X,_Y,true);
  9.    }
  10.    function suelo()
  11.    {
  12.       return _Y >= 194;
  13.    }
  14.    _visible = this.hitTest(_root.mascara);
  15.    _X = _X - heroe.scrollspeed;
  16.    if(mover)
  17.    {
  18.       this.gotoAndStop("fly");
  19.       if(this.hotzone.hitTest(heroe.sprite.hotzone))
  20.       {
  21.          !dy ? (heroe.damage = 6) : (heroe.damage = 10);
  22.          heroe.hitted = true;
  23.       }
  24.       _X = _X + dx;
  25.       _Y = _Y + dy;
  26.       if(dy != 0)
  27.       {
  28.          if(heroe._x > _X && heroe.horizontal > 0)
  29.          {
  30.             dx += 2;
  31.          }
  32.          if(heroe._x < _X && heroe.horizontal < 0)
  33.          {
  34.             dx -= 2;
  35.          }
  36.       }
  37.       if(wallizq() || wallder() || suelo())
  38.       {
  39.          mover = false;
  40.          this.gotoAndStop("crash");
  41.          if(dy != 0)
  42.          {
  43.             x = new Sound();
  44.             x.attachSound("freezeattack");
  45.             x.start();
  46.          }
  47.       }
  48.       if(dy != 0)
  49.       {
  50.          i++;
  51.          shObj = {_x:_X,_y:_Y,dx:0,dy:2,mover:true};
  52.          _root.shineNoloop.duplicateMovieClip("shineNoloop" + i,10 + i,shObj);
  53.       }
  54.    }
  55.    if(borrar)
  56.    {
  57.       this.removeMovieClip();
  58.       borrar = false;
  59.    }
  60. }
  61.